package com.hqyj.controller;


import com.hqyj.pojo.AttendanceSheet;
import com.hqyj.service.IAttendanceSheetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.HashMap;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author rock
 * @since 2021-10-20
 */
@RestController
@RequestMapping("/attendance")
public class AttendanceSheetController {
    @Autowired
    IAttendanceSheetService attendanceSheetService;

    @RequestMapping("/attendanceList")
    public HashMap<String,Object> listPage(Model model,AttendanceSheet attendanceSheet){
        System.out.println(attendanceSheet);

        return attendanceSheetService.queryAttendancList(attendanceSheet);
    }
    @RequestMapping("/add")
    public HashMap<String,Object> insert(Model model,AttendanceSheet attendanceSheet){
        System.out.println("+++"+attendanceSheet.getAttendanceDate().getClass());
        return attendanceSheetService.insertAttendance(attendanceSheet);
    }
    @RequestMapping("/update")
    public HashMap<String,Object> updateOne(Model model,AttendanceSheet attendanceSheet){
        System.out.println("+++"+attendanceSheet);

        return attendanceSheetService.updateAttendance(attendanceSheet);
    }
    @RequestMapping("/del")
    public HashMap<String,Object> del(Model model,AttendanceSheet attendanceSheet){

        return attendanceSheetService.delAttendance(attendanceSheet);
    }

}

